import http from "@/http/http.js";
import { Exception } from "sass";

//列表
export function listReq() {
  return http({
    url: "/posts",
    method: "get",
  });
}

//删除
export function delReq(id) {
  return http({
    url: "/posts/" + id,
    method: "delete",
    data: {
      id,
    },
  });
}

//修改
export function editReq(title, content, id) {
  return http({
    url: "/posts/" + id,
    method: "patch",
    data: {
      title,
      content,
    },
  });
}
//修改状态
export function FnReq(status,id) {
  return http({
    url: "/posts/" + id,
    method: "patch",
    data: {
      status,
    },
  });
}
